<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        input{
            /*去除蓝的边框*/
            outline:none;
            padding-left: 6px;
        }
    </style>
    <script>
        window.onload = function(){
            function $(id){
                return document.getElementById(id);
            }
            $("but").onclick = function(){
                if($("txt").value == "9527是谁")
                {alert("中了");}
                else{alert("滚蛋！！！");}
            }
            $("txt").focus();//自动获取焦点
            $("txt").onmousemove = function(){
                this.select();
            }
          /*  $("txt").onclick  = function () {
                this.on
            }*/
        }
    </script>
</head>
<body>
<input type="text" value="" id="txt"><button id="but">查询</button>
</body>
</html>